module WindSpirit
{
    export class RankItem extends egret.DisplayObjectContainer
    {
        public rankLabel: egret.TextField;
        public nickLabel: egret.TextField;
        public scoreLabel: egret.TextField;
        public constructor(nick:string,score:number,rank:number,avatar:string = null)
        {
            super();
            this.width = 400;
            var rankLabel = new egret.TextField;
            rankLabel.size = 30;
            rankLabel.text = rank.toString();
            rankLabel.textColor = 0xffffff;
            this.rankLabel = rankLabel;
            this.addChild(rankLabel);
            
            var nickLabel = new egret.TextField;
            nickLabel.size = 30;
            nickLabel.text = nick;
            nickLabel.textColor = 0xffffff;
            nickLabel.x = this.width * 0.2;
            this.nickLabel = nickLabel;
            
            this.addChild(nickLabel);
            
            var scoreLabel = new egret.TextField;
            scoreLabel.size = 30;
            scoreLabel.x = 0.7 * this.width;
            scoreLabel.text = score.toString();
            scoreLabel.textColor = 0xffffff;
            this.rankLabel = scoreLabel;
            this.addChild(scoreLabel);
            this.height = 80;
        }
    }
}